//
// AWS Manager - A free AWS console application demonstrating advanced concepts
// Copyright (C) 2008-2010 Sean O'Dell. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.awsmanager.common;

import com.xerox.amazonws.ec2.Jec2;

/**
 *
 * @author Sean ODell
 */
public class EC2Region {

    private String regionName;
    private String regionUrl;
    private String regionDisplayName;
    private String server;
    private String serverResourcePrefix;
    private int serverPort;
    private String proxyHost;
    private int proxyPort;
    private Jec2 regionConnection;

    public String getRegionName() {
        return regionName;
    }

    public void setRegionName(String regionName) {
        this.regionName = regionName;
    }

    public String getRegionUrl() {
        return regionUrl;
    }

    public void setRegionUrl(String regionUrl) {
        this.regionUrl = regionUrl;
    }

    public String getRegionDisplayName() {
        return regionDisplayName;
    }

    public void setRegionDisplayName(String regionDisplay) {
        this.regionDisplayName = regionDisplay;
    }

    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    public String getServerResourcePrefix() {
        return serverResourcePrefix;
    }

    public void setServerResourcePrefix(String serverResourcePrefix) {
        this.serverResourcePrefix = serverResourcePrefix;
    }

    public int getServerPort() {
        return serverPort;
    }

    public void setServerPort(int serverPort) {
        this.serverPort = serverPort;
    }

    public void setServerPort(String serverPortStr) {
        if (serverPortStr != null) {
            try {
                this.serverPort = Integer.parseInt(serverPortStr);
            } catch (Exception ex) {
                this.serverPort = -1;
            }
        } else {
            this.serverPort = -1;
        }
    }

    public String getProxyHost() {
        return proxyHost;
    }

    public void setProxyHost(String proxyHost) {
        this.proxyHost = proxyHost;
    }

    public int getProxyPort() {
        return proxyPort;
    }

    public void setProxyPort(int proxyPort) {
        this.proxyPort = proxyPort;
    }

    public void setProxyPort(String proxyPortStr) {
        if (proxyPortStr != null) {
            try {
                this.proxyPort = Integer.parseInt(proxyPortStr);
            } catch (Exception ex) {
                this.proxyPort = -1;
            }
        } else {
            this.proxyPort = -1;
        }
    }

    public Jec2 getRegionConnection() {
        return regionConnection;
    }

    public void setRegionConnection(Jec2 regionConnection) {
        this.regionConnection = regionConnection;
    }
}
